package edu.gmu.messages;

import edu.gmu.middleware.Message;
import edu.gmu.streams.BlockInputStream;
import edu.gmu.streams.BlockOutputStream;
import java.io.IOException;

public class ExchangeResponse implements Message
{
    public Neighbors neighbors;
    
    public ExchangeResponse()
    {

    }
    
    public ExchangeResponse( boolean accepted, Neighbors neighbors)
    {
        this.neighbors = neighbors;
    }
    
    
    public void setNeighbors( Neighbors neighbors )
    {
        this.neighbors = neighbors;
    }
    
    public Neighbors getNeighbors()
    {
        return this.neighbors;
    }

    public void marshal(BlockOutputStream stream) throws IOException
    {
        this.neighbors.marshal(stream);
    }
    
    public void unmarshal(BlockInputStream stream) throws IOException
    {
        this.neighbors = new Neighbors();
        this.neighbors.unmarshal(stream);
    }
}
